package cn.dhnep.demo.controller;


import cn.dhnep.demo.pojo.vo.RespBean;
import cn.dhnep.demo.service.RoleService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author dhn
 * @since 2021-09-07
 */
@RestController
@RequestMapping("/dhn/message")
public class RoleController {

    @Resource
    private RoleService roleService;

    @ApiOperation("查询所有角色和对应的权限")
    @GetMapping("getAllRole")
    public RespBean getAllRole(@RequestParam(value = "roleName", required = false) String roleName) {
        return RespBean.success(null, roleService.getAllRole(roleName));
    }

}

